import request from './request'

// 获取书签列表
export function getBookmarks(params) {
  return request({
    url: '/bookmarks',
    method: 'get',
    params
  })
}

// 获取单个书签
export function getBookmark(id) {
  return request({
    url: `/bookmarks/${id}`,
    method: 'get'
  })
}

// 创建书签
export function createBookmark(data) {
  return request({
    url: '/bookmarks',
    method: 'post',
    data
  })
}

// 更新书签
export function updateBookmark(id, data) {
  return request({
    url: `/bookmarks/${id}`,
    method: 'put',
    data
  })
}

// 删除书签
export function deleteBookmark(id) {
  return request({
    url: `/bookmarks/${id}`,
    method: 'delete'
  })
}

// 增加书签点击次数
export function incrementClickCount(id) {
  return request({
    url: `/bookmarks/${id}/click`,
    method: 'put'
  })
}

// 获取所有标签
export function getTags() {
  return request({
    url: '/bookmarks/tags',
    method: 'get'
  })
}

// 批量创建书签
export function createBookmarksBatch(data) {
  return request({
    url: '/bookmarks/batch',
    method: 'post',
    data
  })
}

// 解析并导入HTML书签
export function importBookmarksFromHtml(data) {
  return request({
    url: '/bookmarks/import/html',
    method: 'post',
    data
  })
} 